package com.monise.model;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;


@Entity
@Table(name = "CLIENTE")
public class Cliente implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	/*@SequenceGenerator(name="CLIENTE_SEQUENCE", sequenceName="CLIENTE_SEQUENCE", initialValue=1, allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CLIENTE_SEQUENCE")*/
	@Column(name = "pkCliente")
	private Long pkCliente;
	
	@Column(name = "nome")
	private String nome;
	
	@Column(name = "status")
	private int status;
	
/*	@OneToMany(mappedBy = "CLI_ANI") 
	@JoinTable(name="CLI_ANI",joinColumns=@JoinColumn(name="CLI_ID"), inverseJoinColumns=@JoinColumn(name="ANI_ID"))
	private Collection<Animal> animal;*/
	
	@OneToMany(mappedBy = "cliente") 
	private Collection<ClienteAnimal> clienteAnimal;
	
	@OneToMany
	@JoinTable(name="CLIENTE_CONTATO",joinColumns=@JoinColumn(name="CLI_ID"), inverseJoinColumns=@JoinColumn(name="CONT_ID"))
	private Collection<Contato> contato;
	
	@OneToOne
	@JoinColumn(name="fkEndereco")
	private Endereco endereco;

	public Long getPkCliente() {
		return pkCliente;
	}

	public void setPkCliente(Long pkCliente) {
		this.pkCliente = pkCliente;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Collection<ClienteAnimal> getClienteAnimal() {
		return clienteAnimal;
	}

	public void setClienteAnimal(Collection<ClienteAnimal> animal) {
		this.clienteAnimal = animal;
	}

	public Collection<Contato> getContato() {
		return contato;
	}

	public void setContato(Collection<Contato> contato) {
		this.contato = contato;
	}

	public Endereco getEndereco() {
		return endereco;
	}

	public void setEndereco(Endereco endereco) {
		this.endereco = endereco;
	}
	
	@Override
	public String toString() {
		return   nome;
	}
	

}
